home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 31
/
Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso
/
Aminet
/
dev
/
c
/
ctags.lha
/
ctags-3.0.3
/
strstr.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-02-17
|
917b
|
39 lines
/*****************************************************************************
* $Id: strstr.c,v 7.1 1998/12/07 01:38:00 darren Exp $
*
* Copyright (c) 1996-1998, Darren Hiebert
*
* This source code is released for free distribution under the terms of the
* GNU General Public License.
*
* This module contains a substitute for a potentially missing ANSI C
* function.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <string.h>
#ifndef HAVE_STRSTR
extern char * strstr( str, substr )
const char *const str;
const char *const substr;
{
const size_t length = strlen(substr);
const char *match = NULL;
const char *p;
for (p = str ; *p != '\0' ; ++p)
if (strncmp(p, substr, length) == 0)
{
match = p;
break;
}
return match;
}
#endif
/* vi:set tabstop=8 shiftwidth=4: */